<?php
include 'sysco.function.php';

$con = mysql_connect($HOST, $USER, $PASS);
mysql_select_db($DB);

$month = 1;
$menuProdCountArr = array('lp000051383792' => 506, 'lp000051396857' => 292, 'lpLaVigaRwc' => 121);
$menuProdCount = $menuProdCountArr[$MERCHANT];

if ($month == 1) {
  $_SESSION['from'] = '2012-12-02 03:00:00';
  $_SESSION['to'] = '2013-02-01 02:59:00';
} else if ($month == 2) {
  $_SESSION['from'] = '2012-12-30 03:00:00';
  $_SESSION['to'] = '2013-03-01 02:59:00';
}
$noOrdersItems = getNoSoldItems($MERCHANT);
$noOrdersItems = count($noOrdersItems);

$prc = $noOrdersItems / $menuProdCount;
echo $noOrdersItems.' Items (='.round($prc*100).'%) did not sell in the last 60 days'."\n";
?>
